package com.example.class1.Controller;

import com.example.class1.Service.JobService;
import com.example.class1.entity.Job;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/job")
public class JobController {
    @Autowired
    JobService jobService;

    @RequestMapping("/select")
    public List<Job> select() {
        return jobService.select();
    }

    @PostMapping("/add")
    public int add(Job job) {
        return jobService.add(job);
    }

    @RequestMapping("/delete")
    public int delete(Integer id) {
        return jobService.delete(id);
    }

    @RequestMapping("/update")
    public int update(Job job) {
        return jobService.update(job);
    }

    @RequestMapping("/find")
    public List<Job> find() {
        return jobService.find();
    }

}

